<?php session_start(); ?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head><title>Parent Informer RCSHS - Year Level Selection</title>

<link rel=stylesheet href="../../css-layouts/themes/defaulttheme.css" type="text/css">
<link rel=stylesheet href="../../css-layouts/headlinks.css" type="text/css">
<link rel=stylesheet href="../../css-layouts/imglinks.css" type="text/css">

<script src="../../jsc/yrlvlfunc.js" type="text/javascript">

</script>

</head>

<?php 

 require_once("../../sqlconfig.php");

 mysql_connect($server, $sqlusr, $sqlpass) or die(mysql_error()); 
 mysql_select_db($mydb) or die(mysql_error()); 

 //Checks if there is a login cookie
 if(isset($_COOKIE["parentinformerprcshs"]) || isset($_COOKIE["parentinformerurcshs"])) { 
  if(isset($_COOKIE["parentinformerprcshs"])) {
   $username = $_COOKIE["parentinformerprcshs"]; 
  }
  else {
   $_SESSION['theerrcode'] = 2;
   header("Location: ../logerr_atmpt.php");
  }
  $pass = $_COOKIE["parentinformerurcshs"];
  $check = mysql_query("SELECT * FROM logtbl WHERE usernm = '".$username."'") or die(mysql_error());
  while($info=mysql_fetch_array($check)) {
   if ($pass!=$info['pwrnd']) {
    $_SESSION['theerrcode'] = 2;
    header("Location: ../logerr_atmpt.php");
   }
   else {

    /*
	 * The following blocks redirect users who are not advisers
	 * or administrators to their own pages.
	 */
    if($info['priv'] != 1) {
     header("Location: verpass.php");
     die();
	}
   

?>

<body>

<div id="mainhead"><br><br><br></div>


<p class="leftnav">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Logged in as: <?php echo $_COOKIE["parentinformerprcshs"]; ?>
</p>

<p class="rightnav">

<?php

    if($info['priv']==1) {
     echo "<a href='../acctmgnt'>Account Management</a> || ";
    }

?>
<a href="../settings">Settings</a> || <a href="../redirout.php">Logout</a>
</p>

<hr style="clear: both;"><br>

<center>
<div id="yrlvltitle"><br><br><br><br><br><br></div>
</center>

<br><br>

<center>


<table align=center class="tablelinksmain">

<tr>
<td><a href="verpass.php?yrlvl=frst" onMouseover="lightup('first');" onMouseout="turnoff('first');">
<img src="../../img/yrlvl/first.png" width=340 height=200 name=first alt="FIRST YEAR">
</a></td>
<td><a href="verpass.php?yrlvl=secnd" onMouseOver="lightup('second');" onMouseOut="turnoff('second');">
<img src="../../img/yrlvl/second.png" width=340 height=200 name=second alt="SECOND YEAR">
</a></td>
</tr>

<tr>
<td><a href="verpass.php?yrlvl=thrd" onMouseOver="lightup('third');" onMouseOut="turnoff('third');">
<img src="../../img/yrlvl/third.png" width=340 height=200 name=third alt="THIRD YEAR">
</a></td>

<td><a href="verpass.php?yrlvl=frth" onMouseOver="lightup('fourth');" onMouseOut="turnoff('fourth');">
<img src="../../img/yrlvl/fourth.png" width=340 height=200 name=fourth alt="FOURTH YEAR">
</a></td>

</tr>

</table>
</center>

<br>

<div class="footnav" align=center>

<hr>


<a href="../../index.php">Main Page</a> ||
<a href="#">Help</a> ||
<a href="../../externalaffairs/links.php">Links</a> ||
<a href="#">About</a>
<br>

<span id="copyme">
&copy; 2011 Roosevelt College Science High School. All rights reserved.
</span>

</div>

</body>

<?php
   }
  }
 }
 else {
  header("Location: ../../");
 }

?>

</html>